import { Vec2, Vec3 } from "cc";
export const lastPosition = new Vec3();

export const setLastPosition = (p: Vec3 | Vec2) => {
  if (p instanceof Vec2) {
    return Vec3.set(lastPosition, p.x, p.y, 0);
  }
  return Vec3.set(lastPosition, p.x, p.y, p.z ?? 0);
};
